import { DataNodeType, FlowNodeType } from "./enum";
import { BaseTypeMax, MainFlowId, RootNodeId, RootTemplateId, type TextGroup } from "./struct";

export const flowInitData = {
  selectedId: MainFlowId.toString(),
  flows: [
    {
      id: MainFlowId.toString(),
      nextNodeId: 2,
      nextEdgeId: 1,
      name: "Main",
      desc: "",
      nodes: [
        {
          id: "0",
          position: { x: 100, y: 100 },
          type: "start",
          flowNodeType: FlowNodeType.Start
        },
        {
          id: "1",
          position: { x: 100, y: 300 },
          type: "end",
          flowNodeType: FlowNodeType.End
        }
      ],
      edges: [
        {
          id: "0",
          source: "0",
          target: "1",
          animated: true,
          type: "special"
        }
      ]
    }
  ]
}

export const textInitData = {
  nextId: 14,
  nextLanguageId: 2,
  nextGroupId: 1,  // 新增分组ID自增计数器
  groups: [        // 新增分组数组
    {
      groupId: 0,
      name: "默认分组",
      desc: "未分类的文本集合",
      elementIds: []
    }
  ],
  languages: [
    { id: 1, name: "中文" },
    { id: 2, name: "英文" },
  ],
  elements: [
    { id: 1, texts: ["剑客", "swordsman"] }
  ]
}

export const TableInitData = {
    nextId:1,
    tables:[],
}

export const dataInitData = {
  nextId: BaseTypeMax + 1,
  dataNodes: [
    {
      id: RootNodeId,
      name: "root",
      desc: "",
      type: DataNodeType.Template,
      value: 0,
      children: [],
      quote: 0,
      parentId: 0,
      needSave: true
    }
  ],
  templateIds: [-1],
  templateArrays: []
}

export const editorSettings = {
  addNewTextToCurrentGroup: true,
}

export const settingsInitData = {
  groupIdMax: 2,
  exportGroups: [
    {
      id: 1,
      name: "客户端",
      desc: "客户端相关配置导出"
    },
    {
      id: 2,
      name: "服务端",
      desc: "服务端相关配置导出"
    }
  ]
}